package com.cloudkinto.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 * 登录日志
 * </p>
 *
 * @author hua
 * @since 2025-01-13
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("t_login_log")
public class LoginLogDo extends Model<LoginLogDo> {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @TableField("tenant_id")
    private Long tenantId;

    @TableField("company_id")
    private Long companyId;

    /**
     * 登录时间
     */
    @TableField("login_time")
    private Date loginTime;

    /**
     * 登录ip
     */
    @TableField("login_ip")
    private String loginIp;

    /**
     * 登录账号
     */
    @TableField("login_user_id")
    private Long loginUserId;

    @TableField("login_username")
    private String loginUsername;

    /**
     * 登录设备
     */
    @TableField("login_device")
    private String loginDevice;

    /**
     * 登录来源
     */
    @TableField("source")
    private String source;


    @Override
    protected Serializable pkVal() {
        return this.id;
    }

}
